﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace Autocentro.Entities
{
    public class VENTA:BaseEntity
    {
        public VENTA()
        {
            DetalleVenta = new List<DETALLEVENTA>();
            Fecha = DateTime.Now.Date;
        }
        public int Id { get; set; }

        [Display(Name = "IdCliente")]
        [Required(ErrorMessage = "El cliente es requerido")]
        [Range(1, 100000, ErrorMessage = "El cliente es requerido")]
        public int IdCliente { get; set; }

        [Display(Name = "Fecha")]
        [Required(ErrorMessage = "La fecha es requerida")]    
        public DateTime Fecha { get; set; }

        [Display(Name = "Total")]
        [Required(ErrorMessage = "El Total es requerido")]
        [Range(0.001, 100000, ErrorMessage = "El Total debe ser mayor a 0")]
        public decimal Total { get; set; }

        public CLIENTE Cliente { get; set; }
        public List<DETALLEVENTA> DetalleVenta { get; set; }

        public bool Cancelada { get; set; }
    
    }
}
